<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('分配地址选择室温采集器')" />
</head>

<body class="gray-bg">
<div class="container-div">
	<div class="row">
		<div class="col-sm-12 search-collapse">
			<form id="baseSubscribe-form">
				<input type="hidden" id="subscriberId" name="subscriberId" th:value="${subscriberId}">
				<div class="select-list">
					<ul>
						<li>
							室温采集器ID：<input type="text" name="brtId"/>
						</li>
						<li>
							<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
						</li>
					</ul>
				</div>
			</form>
		</div>

		<div class="col-sm-12 select-table table-striped">
			<table id="bootstrap-table"></table>
		</div>
	</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
	var prefix = ctx + "module/subscriber/authSubTemp";

	$(function() {
		var options = {
			url: prefix + "/unallocatedSubList",
			sortName: "createTime",
			sortOrder: "desc",
			modalName: "室温采集器",
			showSearch: false,
			showRefresh: false,
			showToggle: false,
			showColumns: false,
			clickToSelect: true,
			rememberSelected: true,
			columns: [{
				field: 'state',
				checkbox: true
			},
				{
					field: 'brtId',
					title: '室温采集器ID'

				},
				{
					field: 'brtName',
					title: '室温采集器型号'
				},

				{
					field: 'installAddress',
					title: '安装地址'
				},
				{
					field: 'installUser',
					title: '安装人'
				},
				{
					field: 'factory.factoryName',
					title: '厂商名称'
				},
				{
					field: 'factory.factoryCode',
					title: '厂商代码'
				}]
		};
		$.table.init(options);
	});

	/* 添加用户-选择用户-提交 */
	function submitHandler() {
		var rows = $.table.selectFirstColumns();
		if (rows.length == 0) {
			$.modal.alertWarning("请至少选择一条记录");
			return;
		}
		var data = { "subscriberId": $("#subscriberId").val(), "brtIds": rows.join() };
		$.operate.save(prefix + "/selectAll", data);
	}
</script>
</body>
</html>